import request from '@/utils/request'
const baseUrl = process.env.VUE_APP_TMS_CONSOLE_HOST
// 获取货物列表
export function fetchCargoList(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-goods/search`,
    method: 'post',
    data
  })
}
// 货物更新或者新增
export function createCargo(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-goods`,
    method: 'post',
    data
  })
}
// 货物删除
export function delCargo(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-goods/batchDelete`,
    method: 'post',
    data
  })
}
// 获取货物类型列表
export function getGoodsTypeList() {
  return request({
    url: `${baseUrl}/api/v1/tms-goods-type/selector`,
    method: 'get'
  })
}

// 获取单位列表
export function getUnitList() {
  return request({
    url: `${baseUrl}/api/v1/tms-unit/selector`,
    method: 'get'
  })
}
